<?php use_helper('Javascript') ?>
<?php $customers = $form->getObject() ?>
<h1><?php echo $customers->isNew() ?  __("New ") : __("Edit ") ?> <?php echo __("Customers") ?></h1>

<form action="<?php echo url_for('inscription/update'.(!$customers->isNew() ? '?customers_id='.$customers->getCustomersId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
          <input type="submit" value=<?php echo __("Join") ?> />
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form->renderGlobalErrors() ?>
      <tr>
        <th><?php echo $form['customers_gender']->renderLabel() ?></th>
        <td>
          <?php echo $form['customers_gender']->renderError() ?>
          <?php echo $form['customers_gender'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['customers_firstname']->renderLabel() ?></th>
        <td>
          <?php echo $form['customers_firstname']->renderError() ?>
          <?php echo $form['customers_firstname'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['customers_lastname']->renderLabel() ?></th>
        <td>
          <?php echo $form['customers_lastname']->renderError() ?>
          <?php echo $form['customers_lastname'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['customers_dob']->renderLabel() ?></th>
        <td>
          <?php echo $form['customers_dob']->renderError() ?>
          <?php echo $form['customers_dob'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['customers_email_address']->renderLabel() ?></th>
        <td>
          <?php echo $form['customers_email_address']->renderError() ?>
          <?php echo $form['customers_email_address'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['customers_telephone']->renderLabel() ?></th>
        <td>
          <?php echo $form['customers_telephone']->renderError() ?>
          <?php echo $form['customers_telephone'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['customers_fax']->renderLabel() ?></th>
        <td>
          <?php echo $form['customers_fax']->renderError() ?>
          <?php echo $form['customers_fax'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['customers_password']->renderLabel() ?></th>
        <td>
          <?php echo $form['customers_password']->renderError() ?>
          <?php echo $form['customers_password'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['customers_newsletter']->renderLabel() ?></th>
        <td>
          <?php echo $form['customers_newsletter']->renderError() ?>
          <?php echo $form['customers_newsletter'] ?>

        <?php echo $form['customers_id'] ?>

        </td>
      </tr>
      <tr>
        <th><?php echo $form['AddressBook']['entry_gender']->renderLabel() ?></th>
        <td>
          <?php echo $form['AddressBook']['entry_gender']->renderError() ?>
          <?php echo $form['AddressBook']['entry_gender'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['AddressBook']['entry_company']->renderLabel() ?></th>
        <td>
          <?php echo $form['AddressBook']['entry_company']->renderError() ?>
          <?php echo $form['AddressBook']['entry_company'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['AddressBook']['entry_firstname']->renderLabel() ?></th>
        <td>
          <?php echo $form['AddressBook']['entry_firstname']->renderError() ?>
          <?php echo $form['AddressBook']['entry_firstname'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['AddressBook']['entry_lastname']->renderLabel() ?></th>
        <td>
          <?php echo $form['AddressBook']['entry_lastname']->renderError() ?>
          <?php echo $form['AddressBook']['entry_lastname'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['AddressBook']['entry_street_address']->renderLabel() ?></th>
        <td>
          <?php echo $form['AddressBook']['entry_street_address']->renderError() ?>
          <?php echo $form['AddressBook']['entry_street_address'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['AddressBook']['entry_suburb']->renderLabel() ?></th>
        <td>
          <?php echo $form['AddressBook']['entry_suburb']->renderError() ?>
          <?php echo $form['AddressBook']['entry_suburb'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['AddressBook']['entry_postcode']->renderLabel() ?></th>
        <td>
          <?php echo $form['AddressBook']['entry_postcode']->renderError() ?>
          <?php echo $form['AddressBook']['entry_postcode'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['AddressBook']['entry_city']->renderLabel() ?></th>
        <td>
          <?php echo $form['AddressBook']['entry_city']->renderError() ?>
          <?php echo $form['AddressBook']['entry_city'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['AddressBook']['entry_state']->renderLabel() ?></th>
        <td>
          <?php echo $form['AddressBook']['entry_state']->renderError() ?>
          <?php echo $form['AddressBook']['entry_state'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['AddressBook']['entry_country_id']->renderLabel() ?></th>
        <td>
          <?php echo $form['AddressBook']['entry_country_id']->renderError() ?>
          <?php echo $form['AddressBook']['entry_country_id'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['AddressBook']['entry_zone_id']->renderLabel() ?></th>
        <td>
          <div id="zone">
          <?php echo $form['AddressBook']['entry_zone_id']->renderError() ?>
          <?php echo $form['AddressBook']['entry_zone_id'] ?>

        <?php echo $form['AddressBook']['address_book_id'] ?>
          </div>
        </td>
      </tr>
    </tbody>
  </table>
</form>
<?php echo observe_field('customers_AddressBook_entry_country_id', array(
    'update'   => 'zone',
    'url'      => 'inscription/editZone',
    'with'     => "'countries=' + $('customers_AddressBook_entry_country_id').value",
    'script' => true
)) ?>